<?php

namespace App\Http\Resources\Article\Category;

use App\Http\Resources\Article\ArticleCategoryDetailResource;
use App\Http\Resources\BaseResource;

class UserOperateListResource extends BaseResource
{
    public function toArray($request): array
    {
        return [
            "id"             => $this->id,
            "targetId"       => $this->targetId,
            "operateType"    => $this->operateType,
            "status"         => $this->status,
            "updatedAt"      => formatDate($this->updatedAt->timestamp),
            "categoryDetail" => ArticleCategoryDetailResource::collection([$this->categoryRel])->getIterator()
                                                             ->current()
        ];
    }
}
